package pl.edu.pw.elka.wedt.sem10Z.jslt.init;

import java.io.File;
import java.util.Collections;
import java.util.List;

import org.apache.log4j.Logger;

import pl.edu.pw.elka.wedt.sem10Z.jslt.filesystem.FileClassifier;
import pl.edu.pw.elka.wedt.sem10Z.jslt.filesystem.FileReader;
import pl.edu.pw.elka.wedt.sem10Z.jslt.filesystem.FileWriter;

public class Run {
	private final static Logger LOGGER = Logger.getLogger(Run.class);
	private final static String BASE_PATH_JS_IBM = "C:/studia/wedt/wedt-categorization";
	private final static String BASE_PATH_JS_PRV = "G:/x_x_studia/sem_7/wedt/projekt/wedt-categorization";
	private final static String BASE_PATH_LT_PRV = "j:/mydocs/pw/8sem-2010l/WEDT/";
	private final static String TRAIN_PATH = "klasyfikacja/TRAIN";
	private final static String TEST_PATH = "klasyfikacja/TEST";
	private final static String RESULT_PATH = "klasyfikacja/RESULT";
	
	public static void main(String[] args) {
		
		FileReader frTrain = new FileReader();
		FileReader frTest = new FileReader();
		FileClassifier fc = new FileClassifier();
		FileWriter fw = new FileWriter();
		
		File basePath = new File(BASE_PATH_JS_PRV);
		
		File filesTrainPath = new File(basePath, TRAIN_PATH);
		frTrain.readFiles(filesTrainPath);
		frTrain.buildGlobalFrequencyList();
		
		File filesTestPath = new File(basePath, TEST_PATH);
		frTest.readFiles(filesTestPath);
		frTest.buildGlobalFrequencyList();
		
		fc.classifyDocuments(frTrain.getDocumentList());
		fw.saveDocuments(fc.getClassifiedContentList(), RESULT_PATH);
	}
}
